package com.yj.idempotence.controller;

import com.yj.idempotence.annotation.CheckToken;
import com.yj.idempotence.dao.TokenImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class CheckTokenController {


    @Autowired
    TokenImpl tokenService;

    @GetMapping("/getToken")
    public String getToken(){
        return tokenService.createToken();
    }


    @GetMapping("/testToken")
    @CheckToken
    public String testIdempotence(){

        return "成功";
    }

}
